<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .navBg{
            color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <ul class="nav">
            <li v-for="(item,idx) in navs"  @click="tab(idx)">
                <a href="javascropt:;" :class="{navBg:idx===bg}">{{item}}</a>
            </li>
        </ul>
        <div v-for="(item,idx) in list" v-show="idx === bg">{{item}}</div>
    </div>
</body>
<script src="https://cn.vuejs.org/js/vue.js"></script>
<script>
    let vm = new Vue({
        el : "#app",
        data : {
            navs:['内容1','内容2','内容3'],
            list:['内容1','内容2','内容3'],
            bg : 0,
        },
        methods:{
            tab:function (idx) {
                this.bg = idx;
            }
        }
    });
</script>
</html>